// 封装用户管理相关接口
import request from '@/utils/request.js'

// 获取用户信息列表
export const getUserInfoListService = ({ pageSize, page }) => {
  return request({
    url: '/api/user/list',
    method: 'GET',
    params: {
      pageSize: pageSize,
      page: page
    }
  })
}

// 用户列表搜索功能实现
export const searchUserService = (data) => {
  return request({
    url: '/api/user/search',
    method: 'GET',
    params: {
      data
    }
  })
}

// 设置用户账号禁言
export const setUserMuteService = ({ id, mute_time }) => {
  return request({
    url: `/api/user/mute/${id}`,
    method: 'PATCH',
    params: {
      mute_time
    }
  })
}

// 封禁用户账号
export const banUserAccountService = ({ id }) => {
  return request({
    url: `/api/user/ban/${id}`,
    method: 'PATCH'
  })
}

// 解封用户账号
export const unbanUserAccountService = ({ id }) => {
  return request({
    url: `/api/user/unban/${id}`,
    method: 'PATCH'
  })
}
